package com.bbms.entity;

import javax.persistence.Entity;

/**
 * @author Administrator
 * 错误代码实体
 */
@Entity
public enum ErrorCode {
	deleteFailed{
		public String getName(){ return "删除失败";}
		public int getCode(){ return 1001;};
	},
    updateFailed{
        public String getName(){return "修改失败";}
        public int getCode(){return 1002;}
    },
    insertFailed{
        public String getName(){return "插入失败";}
        public int getCode(){return 1003;}
    },
    verifyCodeError{
        public String getName(){ return "验证码错误";}
        public int getCode(){ return 1004;}
    },
    passwordError{
        public String getName(){return "用户名或密码错误";}
        public int getCode(){return 1005;}
    },
    loginFailed{
        public String getName(){return "登录失败";}
        public int getCode(){return 1006;}
    },
    getAuthorizationFailed{
        public String getName(){return "权限获取失败";}
        public int getCode(){return 1007;}
    },
    accessDenied {
        public String getName(){return "权限不足";}
        public int getCode(){return 1008;}
    },
    borrowFailed{
		public String getName(){ return "借阅失败";}
		public int getCode(){ return 1009;}
	},
    readerBorrowFailed{
		public String getName(){ return "该读者借阅次数已达上限";}
		public int getCode(){ return 1010;}
	},
    renewBorrowFaild{
		public String getName(){ return "续借失败";}
		public int getCode(){ return 1011;}
	},
    readerRenewBorrowFaild{
		public String getName(){ return "该读者续借次数已达上限";}
		public int getCode(){ return 1012;}
	},
    restoreFaild{
		public String getName(){ return "归还失败";}
		public int getCode(){ return 1013;}
	},
    managerFaild{
		public String getName(){ return "密码错误 或 权限不足";}
		public int getCode(){ return 1014;}
	},
    readerDeleteFailed{
		public String getName(){ return "此读者存在未归还的图书暂不能删除！";}
		public int getCode(){ return 1001;};
	},
    readerBatchDeleteFailed{
		public String getName(){ return "有部分读者存在未归还的图书暂不能删除！！";}
		public int getCode(){ return 1001;};
	},
	managerDeleteFaild{
		public String getName(){ return "此管理员涉及多方面的重要操作暂不能删除！";}
		public int getCode(){ return 1015;}
	};
	
	public abstract String getName();
    public abstract int getCode();
}
